﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;

namespace QPEngine
{
    public class StartUI:MonoBehaviour
    {
        private  Image ProgressImg;
        
        public void Awake()
        {
            this.ProgressImg = this.transform.Find("Panel/Progress/2").GetComponent<Image>();
            Main main = this.transform.parent.parent.GetComponent<Main>();
            main.Progress += UpdateProgress;
        }

        public void UpdateProgress(int size,int current)
        {
            current++;
            float vlaue = (float)current / (float)size;
            this.ProgressImg.fillAmount= vlaue;
        }
    }
}
